package com.hongxin.nw.netty.down;

import com.hongxin.nw.netty.model.Transfer;
import com.hongxin.nw.netty.utils.FieldPack;
import com.hongxin.nw.netty.values.StaticValue;
import com.hongxin.nw.netty.values.TypeIdentif;

/**
 * @remark 向设备发送U帧启动传输
 * @author: GuoXiaolin
 * @date 2019/6/25 11:46
 * @Version 1.0
 * @Descibe
 */
public class StartReq implements IChannelRequest {

    @Override
    public String doPacking(Transfer transfer) throws Exception {
        //向设备发送U帧启动传输,,发送此指令,,设备才会主动发送信息到服务器(netty)
//        APCI ac1 = new APCI();
//        ac1.setIdentifyStart(TypeIdentif.IDENTIFY_START.getInt());
//        ac1.setApduLength(0);
//        ac1.setContarea(TypeIdentif.FORMAT_U.getStr(), StaticValue.U_START_V);
//        return ac1.getHexData();

        int length = 0;
        return FieldPack.packAPCI(length,TypeIdentif.FORMAT_U.getStr(), StaticValue.U_START_V);
    }

}
